package middleware

import (
	"chat-box/pkg"

	"github.com/gin-gonic/gin"
)

func Middleware(c *gin.Context) {
	token := c.GetHeader("token")
	userId, _ := pkg.GetToken(token)
	c.Set("userId", userId)
	c.Next()
}
